package com.baidu.utils;

import com.baidu.aip.face.AipFace;
import com.baidu.aip.nlp.AipNlp;

import static com.baidu.utils.App.*;

//AipOcrSample 实例化文字识别对象
//配置参数
public class AipNlpSample {

    private static AipNlp aipNlp;

    public static AipNlp getAipNlp(){
        if(aipNlp == null){
            aipNlp = new AipNlp(APP_ID, API_KEY, SECRET_KEY);
            // 可选：设置网络连接参数
            aipNlp.setConnectionTimeoutInMillis(2000);
            aipNlp.setSocketTimeoutInMillis(60000);
        }

        return aipNlp;
    }

}